<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
	Add Pixel
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1>Add Pixel</h1>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
		<fieldset>
			<legend>Add Pixel</legend>
		<?php if (isset($errors)) 
				{
					foreach ($errors as $error)
					{
		?>
				<p class="msg error"><?php echo $error;?></p>
		<?php		}
				}
		?>
		<form method="POST" action="<?php echo url('pixel/insert');?>">
		<table class="nostyle">
			<tr>
				<td>Site:</td>
				<td>
					<select name="siteid">
						<option value="">--Choose a Site--</option>
						<?php foreach($sites as $site) { ?>
						<option value="<?php echo $site['id'];?>" <?php echo (isset($siteid) && $siteid == $site['id']) ?  'selected="selected"' : ''; ?>><?php echo $site['name'];?></option>
						<?php } ?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Position:</td>
				<td>
					<select name="pos">
						<option value="">--Choose a Pixel Position--</option>
						<option value="home" <?php echo ('home' == $pixel['pos']) ?  'selected="selected"' : ''; ?>>Home</option>
						<option value="after_basic_reg" <?php echo ('after_basic_reg' == $pixel['pos']) ?  'selected="selected"' : ''; ?>>After Basic Reg</option>
						<option value="after_full_reg" <?php echo ('after_full_reg' == $pixel['pos']) ?  'selected="selected"' : ''; ?>>After Full Reg</option>
						<option value="more_credit" <?php echo ('more_credit' == $pixel['pos']) ?  'selected="selected"' : ''; ?>>More Credit</option>
						<option value="leader_board" <?php echo ('leaderboard' == $pixel['pos']) ?  'selected="selected"' : ''; ?>>Leaderboard</option>
						<option value="not_login" <?php echo ('not_login' == $pixel['pos']) ?  'selected="selected"' : ''; ?>>Not Login</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>Pixel Code:</td>
				<td><textarea name="pixel" cols="100" rows="5"><?php if (isset($pixel['pixel'])) echo $pixel['pixel'];?></textarea></td>
			</tr>
			<tr>
				<td colspan="2" class="t-right"><input type="submit" class="input-submit" value="Save"/></td>
			</tr>
		</table>
		</form>
	</fieldset>
</div>
<?php $this->_endblock(); ?>